Fix: skip pre-start timesync init for igc - #1666
Conversation
|
Tested with DirectView LED project by enabling PTP, observed Seg fault when ran on I225 NIC (igc kernel driver). "dvledtx" received signal SIGSEGV, Segmentation fault. #0 eth_igc_timesync_enable () [librte_net_e1000.so.26.0] These changes fix seg fault seen. Also the PR #1629 has similar changes. |
There was a problem hiding this comment.
Thanks for the contribution, but I think there may be a misunderstanding of what this patch is trying to achieve.
What's happening here is that the no_timesync flag is being set on the MTL side, which means this implementation is not operating on the hardware clock. Instead, it relies on TSC time with a software-adjusted delta which is essentially a best-effort PTP approximation.
This approach has inherent limitations in terms of accuracy and reliability compared to true hardware timestamping. Could you clarify the intended use case, or consider revisiting the implementation to leverage proper hardware clock support if the goal is genuine PTP compliance?
|
we are working on bringing support on 225 -> this is happening rn, I would reather recommand clients to work with ptp synchronized system tbh But i can see this as a temporary workaround if properlly documented? |
@DawidWesierski4 when PTP is enabled in MTL and runs on I225/I226 hardware we see the Segmentation fault, this change avoids it. PR #1629 also has similar fixes. |
Understandable but my point still stands, please comment above that TODO unlock and add a warning when this case is triggered
I Can even merge it as is and just add warnings in separete PR if you are pressed for time |
|
Hi i wanted to add some testing and other functionality so i cherry picked your changes into my branch i preserved the auther and plan to rebase the chagne so the change will have your name on it but i changed them tad bit so it passes our doc/coding-standard.md please review it, and don't hesitate to be brutal about feedback |
Even if user enable PTP on the hardware which doesn't support PTP(ex. I225- kernel driver IGC) should not cause any failure from MTL side(like seg fault), instead it should give a WARN message and switch to software PTP calculation. Feel free to fix which holds good as per MTL codeflow |
Summary
This PR updates
mt_dev_create()to avoid pre-start time sync initialization on IGC.IGC requires different handling for timesync startup timing. This change prevents invoking the pre-start timesync init path for IGC while keeping existing behavior unchanged for other PF drivers.
File changed
lib/src/dev/mt_dev.cDiff
In the DPDK 21.11+ pre-start timesync path, add an extra guard:
dev_start_timesync()for PF ports when PTP service or HW timestamp is requested.inf->drv_info.drv_type == MT_DRV_IGC.